package com.work.demo.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Car implements Serializable {

	private String name;

	private Integer price;

	private String address;

	public static void main(String[] args) {
		List<Car> cars = new ArrayList<>();
		for (int i = 0; i < 3; i++) {
			Car car = new Car();
			car.setName("Linya" + i);
			car.setAddress("wandan" + i);
			car.setPrice(23);
			cars.add(car);
		}

		List<String> stringList = new ArrayList<>();

		stringList.add("Linya1");
		stringList.add("Linya2");
		stringList.add("Linya3");
		stringList.add("Linya4");
		stringList.add("Linya5");
		stringList.add("Linya6");

		boolean b = stringList.retainAll(cars);
		System.out.println(b);
		System.out.println(stringList);
	}
}
